package com.my.junit;

import com.my.junit.filter.FooFilter;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.context.annotation.Bean;

/**
 * @author Zijian Liao
 * @since 1.0.0
 */
@ServletComponentScan
@MapperScan(basePackages = "com.my.junit.mapper")
@SpringBootApplication
public class JunitApplication {

    public static void main(String[] args) {
        SpringApplication.run(JunitApplication.class, args);
    }

    @Bean
    public FilterRegistrationBean<FooFilter> addTimeFilterBean() {
        FilterRegistrationBean<FooFilter> registration = new FilterRegistrationBean<>();
        registration.setFilter(new FooFilter());
        registration.setName("fooFilter");
        return registration;
    }
}
